home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir37 / ms_sh23s.zip / SRC / MAKEFILE < prev    next >
Text File  |  1994-08-28  |  10KB  |  347 lines

  1. #
  2. # MS-DOS SHELL - Makefile
  3. #
  4. # MS-DOS SHELL - Copyright (c) 1990,4 Data Logic Limited.
  5. #
  6. # Redistribution and use in source and binary forms are permitted
  7. # provided that the above copyright notice is duplicated in the
  8. # source form.
  9. #
  10. #
  11. #    $Header: /usr/users/istewart/shell/sh2.3/Release/RCS/makefile,v 2.11 1994/08/28 15:18:03 istewart Exp $
  12. #
  13. #    $Log: makefile,v $
  14. # Revision 2.11  1994/08/28  15:18:03  istewart
  15. # Fix miss-spelling
  16. #
  17. # Revision 2.10  1994/08/25  20:58:47  istewart
  18. # MS Shell 2.3 Release
  19. #
  20. # Revision 2.9  1994/02/01  10:25:20  istewart
  21. # Release 2.3 Beta 2, including first NT port
  22. #
  23. # Revision 2.8  1994/01/20  14:51:43  istewart
  24. # Release 2.3 Beta 1
  25. #
  26. # Revision 2.7  1994/01/11  17:55:25  istewart
  27. # Release 2.3 Beta 0 patches
  28. #
  29. # Revision 2.6  1993/08/25  16:03:57  istewart
  30. # Beta 225 - see Notes file
  31. #
  32. # Revision 2.5  1993/07/02  10:25:53  istewart
  33. # 224 Beta fixes
  34. #
  35. # Revision 2.4  1993/06/16  12:55:32  istewart
  36. # Expand a bit on the required environment variables
  37. #
  38. # Revision 2.3  1993/06/14  10:59:32  istewart
  39. # More changes for 223 beta
  40. #
  41. # Revision 2.0  1992/04/13  17:40:33  Ian_Stewartson
  42. # MS-Shell 2.0 Baseline release
  43. #
  44. #
  45. # This makefile builds four versions of the shell:
  46. #
  47. #  MSDOS - 16 bit
  48. #  MSDOS - 32 bit (shell does not work).  The extender core dumps.
  49. #  OS/2 - 16 bit
  50. #  OS/2 - 32 bit
  51. #
  52. # You need to select $(CC) as follows:
  53. #
  54. # Set CC to the compiler:
  55. #
  56. #    icc    - IBM C Set/2
  57. #    cl     - Microsoft C 5.1 or C6.0
  58. #    tcc    - Borland Turbo C
  59. #    wcc386 - WATCOM C 386 (for the MSDOS 32-bit version).
  60. #    gcc    - GCC/EMX 2.5.? for OS/2
  61. #
  62. # Set up the environment variables for the compiler to find its include and
  63. # lib directories.  Normally, these variables are INCLUDE and LIB.
  64. #
  65. # The makefile assumes you are re-building the shell, using the shell as
  66. # the primary command line processor.  Hence the OSMODE variable which
  67. # indicates if you are building on MSDOS or OS/2.
  68. #
  69. # I use Microsoft as the main development environment, so I have a
  70. # variable TFLAG_MSC which tells the makefile whether I want to build the
  71. # optimised (-Olt) or debug (-Zid) version.  For OS/2 2.x, I've used the
  72. # IBM C Set/2 and a variable TFLAG_IBM with values -O or -(debug options).
  73. #
  74. # BETA is set to the release name (V2xxBeta) or RELEASE.
  75. #
  76. # You may need to uncomment one or more following, if the associated environment
  77. # variable is to something else.
  78. #
  79. #SHELL=/bin/sh
  80. #BETA=RELEASE
  81. #CC=cl
  82. #OSMODE=0
  83. #TFLAG_MSC=-Olt
  84. #TFLAG_IBM=-O
  85. #TFLAG_WAT=-olt
  86. #TFLAG_WAT=-d2
  87. #ASDEBUG=/Zi /Zd
  88.  
  89.  
  90. LINK=/BATCH/NOLOGO/FARCALL/NOE/ST:8000
  91.  
  92. #
  93. # MSDOS build options
  94. #
  95.  
  96. MSC_DOS_16_Options=-AL $(TFLAG_MSC) -Iinclude -W3 -nologo
  97. TC_DOS_16_Options=-ml -Iinclude -N -Z -G -O -wpro -wuse -w-par -w-pia
  98. WAT_DOS_32_Options=-mf -Iinclude -zq $(TFLAG_WAT)
  99. GCC_Options=-Iemxinc $(TFLAG_GCC)
  100.  
  101. #
  102. # OS/2 1.x build options using Microsoft C6.0
  103. #
  104.  
  105. MSC_OS2_16_Options=-AL $(TFLAG_MSC) -W3 -DOS2 -nologo
  106. MSC_OS2_16_DOptions=-AL $(TFLAG_MSC) -W3 -DOS2 -nologo -DOS2_DOSALLOC
  107. #MSC_OS2_16_DOptions=-AL $(TFLAG_MSC) -W3 -DOS2 -nologo
  108.  
  109. #
  110. # OS/2 2.x build options using IBM C Set/2 1.0 or WATCOM 9.0
  111. #
  112. # Note the WATCOM options for OS/2 and DOS 32-bit mode are the same.
  113. #
  114.  
  115. IBM_OS2_32_Options=-Q $(TFLAG_IBM) -Sm -Iinclude
  116. WAT_OS2_32_Options=-mf -Iinclude -zq $(TFLAG_WAT)
  117.  
  118. #
  119. # Objects and sources
  120. #
  121.  
  122. OBJS=    sh1.obj sh2.obj sh3.obj sh4.obj sh5.obj sh7.obj sh8.obj    \
  123.     sh9.obj sh10.obj sh11.obj sh12.obj sh13.obj sh6.obj
  124. OBJS2=    stdargv.obj glob.obj director.obj
  125.  
  126. OBJS_U=    sh1.o sh2.o sh3.o sh4.o sh5.o sh6.o sh7.o sh8.o \
  127.     sh9.o sh10.o sh11.o sh12.o sh13.o 
  128.  
  129. SRCS=    sh0.asm sh1.c sh2.c sh3.c sh4.c sh5.c sh6.c sh7.c sh8.c    \
  130.     sh9.c sh10.c sh11.c sh12.c sh13.c
  131.  
  132. SRCS_U=    sh1.c sh2.c sh3.c sh4.c sh5.c sh6.c sh7.c sh8.c \
  133.     sh9.c sh10.c sh11.c sh12.c sh13.c
  134.  
  135. SRCS2=    stdargv.c glob.c director.c
  136.  
  137. #
  138. # Targets
  139. #
  140.  
  141. all:    sh
  142. ps:    ps.exe
  143. system: system.exe
  144. showkey: showkey.exe
  145.  
  146. sh6.obj: sh6.c  #$(SRCS)
  147.     @echo Building sh6.obj 1>&2;                    \
  148.     CFLAGS=-c;                            \
  149.     if [ $(CC) = "icc" ];                        \
  150.     then CFLAGS="-c $(IBM_OS2_32_Options)";                \
  151.     elif [ $(CC) = "tcc" ];                        \
  152.     then CFLAGS="-c $(TC_DOS_16_Options)";                \
  153.     elif [ $(CC) = "wcc386" ];                    \
  154.     then CFLAGS="$(WAT_DOS_32_Options)";                \
  155.     elif [ $(OSMODE) = 0 ];                        \
  156.     then export CL="$(MSC_DOS_16_Options)";                \
  157.     else export CL="$(MSC_OS2_16_Options)";                \
  158.     fi;                                \
  159.     $(CC) $$CFLAGS -DRELEASE=$(BETA) sh6.c
  160.  
  161. sh6.o:: sh6.c  #$(SRCS)
  162.     $(CC) -c $(GCC_Options) -DRELEASE=$(BETA) sh6.c
  163.  
  164. #
  165. # Build sh0.asm
  166. #
  167.  
  168. sh0.obj: sh0.asm
  169.     @if   [ $(OSMODE) = 0 -a $(CC) != "wcc386" ];            \
  170.     then  echo Building sh0.obj 1>&2;                \
  171.           if   [ $(CC) = "tcc" ];                    \
  172.           then ASFLAGS="/D__TURBOC__=1 /t /Ml";            \
  173.           else ASFLAGS="/t /Ml";                    \
  174.           fi;                            \
  175.           $(AS) $$ASFLAGS $(ASDEBUG) 'sh0.asm;';            \
  176.     fi
  177.  
  178. sh0.all:
  179.     $(AS) /t /Ml sh0.asm  'sh0_msc;'
  180.     $(AS) /D__TURBOC__=1 /t /Ml sh0.asm  'sh0_tc;'
  181.  
  182. #
  183. # Build sh0.asm
  184. #
  185.  
  186. swap.obj: swap.asm
  187.     @if   [ $(OSMODE) = 0 ];                    \
  188.     then echo Building swap.obj 1>&2;                \
  189.          if [ $(CC) = "tcc" ];                    \
  190.          then ASFLAGS="/D__TURBOC__=1 /t /Ml";            \
  191.          else ASFLAGS="/t /Ml";                    \
  192.          fi;                            \
  193.          $(AS) $$ASFLAGS 'swap.asm;'                \
  194.     fi
  195.  
  196.  
  197. #
  198. # Any .obj.
  199. #
  200. .c.obj:
  201.     @echo Building $*.obj 1>&2;                    \
  202.     CFLAGS=-c;                            \
  203.     if [ $(CC) = "icc" ];                        \
  204.     then CFLAGS="-c $(IBM_OS2_32_Options)";                \
  205.     elif [ $(CC) = "tcc" ];                        \
  206.     then CFLAGS="-c $(TC_DOS_16_Options)";                \
  207.     elif [ $(CC) = "wcc386" ];                    \
  208.     then CFLAGS="$(WAT_DOS_32_Options)";                \
  209.     elif [ $(OSMODE) = 0 ];                        \
  210.     then export CL="$(MSC_DOS_16_Options)";                \
  211.     elif [ $(TFLAG_MSC) = "-Olt" ];                    \
  212.     then export CL="$(MSC_OS2_16_Options)";                \
  213.     else export CL="$(MSC_OS2_16_DOptions)";            \
  214.     fi;                                \
  215.     $(CC) $$CFLAGS $<
  216.  
  217. .c.o:
  218.     $(CC) -c $(GCC_Options) $*.c
  219.  
  220. #
  221. # EMX requires emx.a which contains the QProc import thingy
  222. #
  223.  
  224. emx.a:    emx.def
  225.     emximp -o emx.a emx.imp
  226.  
  227. sh: $(OBJS) sh0.obj
  228.     @echo Linking 1>&2;                        \
  229.     if   [ $(CC) = "icc" ];                        \
  230.     then $(CC) -Fe shos232.exe -Q $(TFLAG_IBM) -Sm $(OBJS)        \
  231.            sh.def -B /BAT;                    \
  232.          if [ "$(TFLAG_IBM)" = "-O" ];                \
  233.          then msgbind sh.bnd;                    \
  234.          fi;                            \
  235.     elif [ $(CC) = "wcc386" ];                    \
  236.     then if   [ $(TFLAG_WAT) = "-d2" ];                \
  237.          then wlink @wsh$(OSMODE)d.lnk;                \
  238.          else wlink @wsh$(OSMODE).lnk;                \
  239.          fi;                            \
  240.     elif [ $(CC) = "tcc" ];                        \
  241.     then tlink /c/e @tsh.lnk;                    \
  242.          exehdr shdos16.exe -stack:0x8000;                \
  243.          ?=0;                            \
  244.     elif [ "$(TFLAG_MSC)" = "-Olt" ];                \
  245.     then link /batch @msh$(OSMODE).lnk;                \
  246.     else link /batch @msh$(OSMODE)d.lnk;                \
  247.     fi
  248.  
  249. shemx: $(OBJS_U)
  250.     $(CC) $(TFLAG_GCC) -o shemx.exe $(OBJS_U) emx.a
  251.  
  252. all3:    swap.obj system.obj
  253.     cl -F 8000 -o system swap system
  254.  
  255. ps.exe: ps.obj $(OBJS2)
  256.     @if [ $(OSMODE) = 1 ];                        \
  257.     then echo Linking ps 1>&2;                    \
  258.          if   [ $(CC) = "icc" ];                    \
  259.          then CFLAGS="-Q $(TFLAG_IBM) -Sm";                \
  260.               $(CC) $$CFLAGS -Fe ps.exe ps.obj $(OBJS2) sh.def;    \
  261.          elif [ $(CC) = "wcc386" ];                    \
  262.          then wlink @ps.lnk;                    \
  263.          elif [ $(CC) = "cl" ];                    \
  264.          then export CL="$(MSC_DOS_16_Options)";            \
  265.               $(CC) -o ps.exe ps.obj $(OBJS2) sh.def -link $(LINK);    \
  266.          fi;                            \
  267.     fi
  268.  
  269. system.obj: system.c
  270.     @CFLAGS=;                            \
  271.     echo Building system.obj 1>&2;                    \
  272.     if [ $(CC) = "icc" ];                        \
  273.     then CFLAGS="$(IBM_OS2_32_Options)";                \
  274.     elif [ $(OSMODE) = 0 ];                        \
  275.     then export CL="$(MSC_DOS_16_Options)";                \
  276.     else export CL="$(MSC_OS2_16_Options)";                \
  277.     fi;                                \
  278.     $(CC) $$CFLAGS -c -DTEST system.c
  279.  
  280. system.exe: system.obj director.obj swap.obj
  281.     @echo Linking system 1>&2;                    \
  282.     if [ $(CC) = "icc" ];                        \
  283.     then $(CC) -Q $(TFLAG_IBM) -Sm -Fe system.exe director.obj    \
  284.                        system.obj;            \
  285.     elif [ $(OSMODE) = 0 ];                        \
  286.     then export CL="$(MSC_DOS_16_Options)";                \
  287.          $(CC) -o system.exe swap.obj director.obj system.obj    \
  288.             -link $(LINK);                    \
  289.     else export CL="$(MSC_OS2_16_Options)";                \
  290.          $(CC) -o system.exe director.obj system.obj -link $(LINK);    \
  291.     fi
  292.  
  293. showkey.exe: showkey.obj
  294.     @echo Linking showkey 1>&2;                    \
  295.     if [ $(CC) = "icc" ];                        \
  296.     then $(CC) -Q $(TFLAG_IBM) -Sm -Fe showkey.exe showkey.obj;    \
  297.     elif [ $(CC) = "cl" ];                        \
  298.     then if [ $(OSMODE) = 0 ];                    \
  299.          then export CL="$(MSC_DOS_16_Options)";            \
  300.          else export CL="$(MSC_OS2_16_Options)";            \
  301.          fi;                            \
  302.          $(CC) -o showkey.exe showkey.c -link $(LINK);        \
  303.     elif [ $(CC) = "wcc386" ];                    \
  304.     then wcl386 $(WAT_OS2_32_Options) showkey.obj;            \
  305.     fi
  306.  
  307. director.exe: director.c
  308.     @echo Linking director 1>&2;                    \
  309.     if [ $(CC) = "icc" ];                        \
  310.     then $(CC) -Q $(TFLAG_IBM) -DTEST -Sm -Fe director.exe        \
  311.         director.c;                        \
  312.     elif [ $(CC) = "cl" ];                        \
  313.     then if [ $(OSMODE) = 0 ];                    \
  314.          then export CL="$(MSC_DOS_16_Options)";            \
  315.          else export CL="$(MSC_OS2_16_Options)";            \
  316.          fi;                            \
  317.          $(CC) -o director.exe -DTEST director.c -link $(LINK);    \
  318.     elif [ $(CC) = "wcc386" ];                    \
  319.     then wcl386 $(WAT_OS2_32_Options) -DTEST director.c;        \
  320.     fi
  321.  
  322. stdargv.exe: stdargv.c
  323.     @echo Linking stdargv 1>&2;                    \
  324.     if [ $(CC) = "icc" ];                        \
  325.     then $(CC) -Q $(TFLAG_IBM) -DTEST -Sm -Fe stdargv.exe        \
  326.         stdargv.c;                        \
  327.     elif [ $(CC) = "cl" ];                        \
  328.     then if [ $(OSMODE) = 0 ];                    \
  329.          then export CL="$(MSC_DOS_16_Options)";            \
  330.          else export CL="$(MSC_OS2_16_Options)";            \
  331.          fi;                            \
  332.          $(CC) -o stdargv.exe -DTEST stdargv.c -link $(LINK);    \
  333.     elif [ $(CC) = "wcc386" ];                    \
  334.     then wcl386 $(WAT_OS2_32_Options) stdargv.c;            \
  335.     fi
  336.  
  337.  
  338. #
  339. #
  340. #
  341.  
  342. unix:        $(OBJS_U) 
  343.         cc -o sh $(OBJS_U)
  344.  
  345. sh6.o::        $(SRCS_U)
  346. #$(OBJS_U)::    sh.h
  347.